package app.fugema.shop.main.order.adapter;

import com.base.common.utils.DensityUtil;
import com.base.common.utils.ViewUtils;
import com.base.common.view.adapter.connector.BaseItemMultiType;
import com.base.common.view.adapter.connector.BaseViewHolder;

import android.view.View;

import app.fugema.shop.R;
import app.fugema.shop.databinding.ItemOrderAddressViewBinding;
import app.fugema.shop.main.order.model.OrderAddressHeadBean;

public class OrderAddrMultiType extends BaseItemMultiType<OrderAddressHeadBean, ItemOrderAddressViewBinding> {

    @Override
    public int getItemViewType()
    {
        return TYPE_HEAD;
    }

    @Override
    public int getLayoutId()
    {
        return R.layout.item_order_address_view;
    }

    @Override
    public void onBindViewHolder(ItemOrderAddressViewBinding binding, int position, BaseViewHolder viewHolder, OrderAddressHeadBean bean)
    {
        super.onBindViewHolder(binding, position, viewHolder, bean);
        if (position == 1)
        {
            //binding.clItemView.getDelegate().setCornerRadius_BR(DensityUtil.getDimens(R.dimen.dp_10));
            //binding.clItemView.getDelegate().setCornerRadius_BL(DensityUtil.getDimens(R.dimen.dp_10));
            ViewUtils.setViewMarginTop(binding.clItemView,0,DensityUtil.getDimens(R.dimen.dp_12));
        }
    }

    @Override
    public void onItemClick(View view, int onclickType, int position, OrderAddressHeadBean bean)
    {
        super.onItemClick(view, onclickType, position, bean);
        //AddressManageActivity.start(view.getContext(), true);
    }
}
